import Mock from 'mockjs'
const Random = Mock.Random
// mock一组数据
const produceNewsData = function () {
  let articles = []
  for (let i = 0; i < 3; i++) {
    let newArticleObject = {
      id: i, //  Random.csentence( min, max )
      imgUrl: Random.dataImage('750x375', 'mock的大图片') // Random.dataImage( size, text ) 生成一段随机的 Base64 图片编码
    }
    articles.push(newArticleObject)
  }

  return {
    swiperList: articles
  }
}
const detailNewsData = function () {
  let articles = []
  for (let i = 0; i < 3; i++) {
    let newArticleObject = {
      id: i, //  Random.csentence( min, max )
      imgUrl: Random.dataImage('750x533', 'mock的大图片') // Random.dataImage( size, text ) 生成一段随机的 Base64 图片编码
    }
    articles.push(newArticleObject)
  }

  return {
    swiperList: articles
  }
}

// Mock.mock( url, post/get , 返回的数据)；
Mock.mock('/home/swiper', 'get', produceNewsData)
Mock.mock('/detail/swiper', 'get', detailNewsData)
